<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>添加救援队伍</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="__LAYUI__/css/layui.css" media="all">
  <link rel="stylesheet" href="__CSS__/common/layui.form.css" media="all">
  <link rel="stylesheet" href="__STATIC__/plugs/font-awesome/css/font-awesome.min.css" media="all">
</head>
<body>
    <div class="layui-container">
        <form class="layui-form layui-clear" action="{:url('basic/hazard/edit',array('hazardId'=>$info.id))}" method="post" id="unitForm">
        	<div class="layui-form-item">
                <label class="layui-form-label">有效性</label>
                <div class="layui-input-block">
                 	<input type="checkbox" name="isValid" lay-skin="switch"  lay-text="有效|无效" {if $info.isValid}checked{/if}>
                 	<input type="hidden" name="id" value="{$info.id}">
                </div>
        	</div>
            <div class="layui-form-item">
            	  <label class="layui-form-label">单位&nbsp;<i class="layui-icon arrow">&#xe642;</i></label>
            	  <div class="layui-input-block">
            	  	<select name="enterpriseId"  lay-filter="linkage" data-url="{:url('admin/ajax.enterprise/getChargePersonList')}" data-child="chargePerson">
            	  		<option></option>
            	  		{volist name="enterpriseList" id="item"}
            	  		<option value="{$key}" {if $info.enterpriseId == $key}selected{/if}>{$item}</option>
            	  		{/volist}
            	  	</select>
            	  </div>
            </div>
            <div class="layui-form-item">
            	<label class="layui-form-label">名称&nbsp;<i class="layui-icon arrow">&#xe642;</i></label>
            	<div class="layui-input-block">
            		 <input class="layui-input demand" name="name" data-set="name" type="text" value="{$info.name}" />
            	</div>
            </div>
            <div class="layui-form-item">
            	  <label class="layui-form-label">类型&nbsp;<i class="layui-icon arrow">&#xe642;</i></label>
            	  <div class="layui-input-block">
            	  	<select name="typeId">
            	  		<option></option>
            	  		{volist name="typeList" id="item"}
            	  		<option value="{$item.subsystemNo}" {if $info.typeId == $item.subsystemName}selected{/if}>{$item.subsystemName}</option>
            	  		{/volist}
            	  	</select>
            	  </div>
            </div>
            <div class="layui-form-item">
            	 <label class="layui-form-label">负责人</label>
            	 <div class="layui-input-block">
            	 	<select name="chargePerson" id="chargePerson" data-value="{$info.chargePerson}"></select>
            	 </div>
            </div>
              <div class="layui-form-item">
                    <label class="layui-form-label">经纬度&nbsp;<i class="layui-icon arrow">&#xe642;</i></label>
                    <div class="layui-input-block">
                        <input class="layui-input layui-position" name="latitudeLongitude"  data-set="latitudeLongitude" readonly value="{$info.latitudeLongitude}"/>
                        <a class="layui-btn layui-btn-small btn-green" id="building" data-url="{:url('basic/enterprise/setBuilding')}"><i class="fa fa-map-marker"></i></a>
                    </div>
                
             </div>
             <div class="layui-form-item">
	              	<label class="layui-form-label">实景图</label>
	  				<div class="layui-input-block">
	  					<div class="layui-upload">
	  					 	<button type="button" class="layui-btn btn-upload" id="hazardImg" data-url="{:url('admin/api.upload/upload')}"><i class="fa fa-plus"></i></button>
		  					 <div class="layui-upload-list">
		  					 	{if $info.imgPath}
		  					 	<img src="__PUBLIC__{$info.imgPath}" class="layui-upload-img" id="imgSample">
		  					 	{/if}
		  					 	<input class="layui-hide" type="text" name="imgPath" value="{$info.imgPath}">
		  					 </div>
	  					</div>
	  				</div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">位置描述</label>
                <div class="layui-input-block">
                    <textarea class="layui-textarea" name="positionDesc" data-set="positionDesc">{$info.positionDesc}</textarea>
                </div>
            </div>
            <div class="layui-form-item">
            	<label class="layui-form-label">传感器</label>
            	<div class = "layui-input-block">
            		<ul class="sensor-list">
            			{volist name="info.sensors" id="sensor"}
            				<li>
            					<span class="sensor-title">{$sensor.title}</span>
            					<input type="hidden" name="sensorIds[]" value="{$sensor.id}">
            				</li>
            			{/volist}
            		</ul>
            		<a class="layui-btn layui-btn-small btn-green" id="sensor" data-url="{:url('basic/hazard/config',array('dangerSourceId'=>$info.id))}"><i class="fa fa-plus"></i></a>
            	</div>
            </div>
           <div class="layui-form-item">
                 <div class="layui-input-block">
                      <button class="layui-btn btn-green" id="save" lay-submit lay-filter="save">保 存 </button>
                       <button class="layui-btn layui-btn-primary" type="reset">重 置</button>
                 </div>  
            </div>
			<input type="hidden" name="sensorIds[]" value="">
        </form>
    </div>  
    <script type="text/javascript" src="__LAYUI__/layui.js"></script>
    <script type="text/javascript" src="__JS__/basic/hazard.js"></script>
       

</body>
</html>           

